package cn.iocoder.yudao.module.happycore.dal.mysql.oxdirectory;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.happycore.controller.admin.oxdirectory.vo.OxDirectoryPageReqVO;
import cn.iocoder.yudao.module.happycore.dal.dataobject.oxdirectory.OxDirectoryDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 目录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OxDirectoryMapper extends BaseMapperX<OxDirectoryDO> {

    default PageResult<OxDirectoryDO> selectPage(OxDirectoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OxDirectoryDO>()
                .likeIfPresent(OxDirectoryDO::getDirectoryName, reqVO.getDirectoryName())
                .eqIfPresent(OxDirectoryDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(OxDirectoryDO::getImagesNum, reqVO.getImagesNum())
                .betweenIfPresent(OxDirectoryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OxDirectoryDO::getId));
    }

}